USE [RD_GLMart]
GO

/****** Object:  Index [PK_GL_Star_FactsDetails]    Script Date: 08/10/2010 08:52:52 ******/
ALTER TABLE [dbo].[GL_Star_FactsDetails] ADD  CONSTRAINT [PK_GL_Star_FactsDetails] PRIMARY KEY CLUSTERED 
(
	[DocumentCompany] ASC,
	[DocumentType] ASC,
	[DocumentNumber] ASC,
	[JournalEntryLineNumber] ASC,
	[LineExtensionCode] ASC,
	[GLDateID] ASC,
	[LedgerTypeCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
GO


USE [RD_GLMart]
GO

/****** Object:  Index [_dta_index_GL_Star_FactsDetails_6_341576255__K13_K21_K16_K11_K8_K10_K7_K12_K9_K2_K24_K23_K30_27]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [_dta_index_GL_Star_FactsDetails_6_341576255__K13_K21_K16_K11_K8_K10_K7_K12_K9_K2_K24_K23_K30_27] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC,
	[CompanyNumber] ASC,
	[LedgerTypeCode] ASC,
	[JournalEntryLineNumber] ASC,
	[DocumentCompany] ASC,
	[DocumentNumber] ASC,
	[SourceID] ASC,
	[LineExtensionCode] ASC,
	[DocumentType] ASC,
	[BusinessUnitID] ASC,
	[Subsidiary] ASC,
	[Object] ASC,
	[ExplanationDescription] ASC
)
INCLUDE ( [Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_Doctype]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_Doctype] ON [dbo].[GL_Star_FactsDetails] 
(
	[DocumentType] ASC,
	[GLPeriodNumber] ASC,
	[Century] ASC,
	[FiscalYear] ASC
)
INCLUDE ( [Account],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDet_CheckDateID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDet_CheckDateID] ON [dbo].[GL_Star_FactsDetails] 
(
	[CheckDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDet_GLDateID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDet_GLDateID] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDet_InvoiceDateID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDet_InvoiceDateID] ON [dbo].[GL_Star_FactsDetails] 
(
	[InvoiceDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_AccountID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_AccountID] ON [dbo].[GL_Star_FactsDetails] 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_AIDID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_AIDID] ON [dbo].[GL_Star_FactsDetails] 
(
	[AIDID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_BusinessUnitID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_BusinessUnitID] ON [dbo].[GL_Star_FactsDetails] 
(
	[BusinessUnitID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_CompanyNumberID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_CompanyNumberID] ON [dbo].[GL_Star_FactsDetails] 
(
	[CompanyNumberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_LedgerTypeID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_LedgerTypeID] ON [dbo].[GL_Star_FactsDetails] 
(
	[LedgerTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [IX_FactsDetails_SubLedgerID]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [IX_FactsDetails_SubLedgerID] ON [dbo].[GL_Star_FactsDetails] 
(
	[SubLedgerID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_1]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_1] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC
)
INCLUDE ( [BusinessUnitID],
[AIDID],
[AccountID],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_148]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_148] ON [dbo].[GL_Star_FactsDetails] 
(
	[DocumentType] ASC,
	[DocumentNumber] ASC
)
INCLUDE ( [Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_237]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_237] ON [dbo].[GL_Star_FactsDetails] 
(
	[SourceID] ASC,
	[DocumentCompany] ASC,
	[DocumentType] ASC,
	[DocumentNumber] ASC,
	[JournalEntryLineNumber] ASC,
	[LineExtensionCode] ASC,
	[LedgerTypeCode] ASC,
	[GLDateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_280]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_280] ON [dbo].[GL_Star_FactsDetails] 
(
	[LedgerTypeCode] ASC,
	[GLPostedCode] ASC,
	[GLPeriodNumber] ASC
)
INCLUDE ( [BusinessUnitID],
[AIDID],
[DocumentType],
[GLDateID],
[Object],
[Amount],
[Ref1JEVouchInvEtc]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_56]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_56] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC,
	[LedgerTypeCode] ASC,
	[CompanyNumber] ASC
)
INCLUDE ( [AIDID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_58]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_58] ON [dbo].[GL_Star_FactsDetails] 
(
	[LedgerTypeCode] ASC,
	[CompanyNumber] ASC
)
INCLUDE ( [AIDID],
[GLDateID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_75]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_75] ON [dbo].[GL_Star_FactsDetails] 
(
	[LedgerTypeID] ASC,
	[GLDateID] ASC
)
INCLUDE ( [BusinessUnitID],
[AIDID],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_76]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_76] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC,
	[LedgerTypeCode] ASC,
	[CompanyNumber] ASC
)
INCLUDE ( [AccountID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_78]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_78] ON [dbo].[GL_Star_FactsDetails] 
(
	[LedgerTypeCode] ASC,
	[CompanyNumber] ASC
)
INCLUDE ( [AccountID],
[GLDateID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_91]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_91] ON [dbo].[GL_Star_FactsDetails] 
(
	[GLDateID] ASC,
	[CompanyNumber] ASC
)
INCLUDE ( [AccountID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_93]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_93] ON [dbo].[GL_Star_FactsDetails] 
(
	[CompanyNumber] ASC
)
INCLUDE ( [AccountID],
[GLDateID],
[Object],
[Subsidiary],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [missing_index_96]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [missing_index_96] ON [dbo].[GL_Star_FactsDetails] 
(
	[AIDID] ASC,
	[CompanyNumber] ASC,
	[Object] ASC,
	[Subsidiary] ASC
)
INCLUDE ( [GLDateID],
[Amount]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

/****** Object:  Index [UnClustered_Object]    Script Date: 08/10/2010 08:52:45 ******/
CREATE NONCLUSTERED INDEX [UnClustered_Object] ON [dbo].[GL_Star_FactsDetails] 
(
	[Account] ASC,
	[DocumentType] ASC,
	[Object] ASC,
	[Amount] ASC,
	[GLPeriodNumber] ASC,
	[Century] ASC,
	[FiscalYear] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO


